package 设计模式.d_原型模式;

/**
 * @author caihe
 * @date 2023/3/9 15:25
 */
public class Phone extends Prototype1<Phone> {
    
    
    private StringBuilder sb;

    public Phone(StringBuilder sb) {
        this.sb = sb;
    }

    public StringBuilder getSb() {
        return sb;
    }

    public void setSb(StringBuilder sb) {
        this.sb = sb;
    }


    public static void main(String[] args) {
        Phone a = new Phone(new StringBuilder("我的手机"));

        Phone phone = a.deepClone();
        phone.getSb().append("111");

        System.out.println(a.getSb().toString());
        System.out.println(phone.getSb().toString());
        

    }
    
}
